#include <stdio.h>

/*
 * break
 */

int main()
{
	int a = 0;

	while (1) {
		printf("1st statement.\n");

		if (++a > 10)
			break;

		printf("2nd statement.\n");
	}

	do {
		printf("1st statement.\n");

		if (--a < 0)
			break;

		printf("2nd statement.\n");
	}
	while (1);

	return 0;
}

#if 0

/*
 * intel
 */
0000000000001149 <main>:
    1149:	f3 0f 1e fa          	endbr64 
    114d:	55                   	push   %rbp
    114e:	48 89 e5             	mov    %rsp,%rbp
    1151:	48 83 ec 10          	sub    $0x10,%rsp
    1155:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%rbp)	// (rbp-0x4)=0

    115c:	48 8d 3d a1 0e 00 00 	lea    0xea1(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    1163:	e8 e8 fe ff ff       	callq  1050 <puts@plt>	// puts()
    1168:	83 45 fc 01          	addl   $0x1,-0x4(%rbp)	// (rbp-0x4)+=0x1
    116c:	83 7d fc 0a          	cmpl   $0xa,-0x4(%rbp)	// (rpb-0x4)-0xa
    1170:	7e 02                	jle    1174 <main+0x2b>	// 小于等于(有符号<=) jump
    1172:	eb 0e                	jmp    1182 <main+0x39>	// jump
    1174:	48 8d 3d 98 0e 00 00 	lea    0xe98(%rip),%rdi        # 2013 <_IO_stdin_used+0x13>
    117b:	e8 d0 fe ff ff       	callq  1050 <puts@plt>	// puts()
    1180:	eb da                	jmp    115c <main+0x13>	// jump

    1182:	48 8d 3d 7b 0e 00 00 	lea    0xe7b(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    1189:	e8 c2 fe ff ff       	callq  1050 <puts@plt>	// puts()
    118e:	83 6d fc 01          	subl   $0x1,-0x4(%rbp)	// (rbp-0x4)-=0x1
    1192:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)	// (rbp-0x4)-0x0
    1196:	78 0e                	js     11a6 <main+0x5d>	// 负数
    1198:	48 8d 3d 74 0e 00 00 	lea    0xe74(%rip),%rdi        # 2013 <_IO_stdin_used+0x13>
    119f:	e8 ac fe ff ff       	callq  1050 <puts@plt>
    11a4:	eb dc                	jmp    1182 <main+0x39>	// jump

    11a6:	90                   	nop
    11a7:	b8 00 00 00 00       	mov    $0x0,%eax
    11ac:	c9                   	leaveq 
    11ad:	c3                   	retq   
    11ae:	66 90                	xchg   %ax,%ax

/*
 * arm
 */
000000000040055c <main>:
  40055c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400560:	910003fd 	mov	x29, sp
  400564:	b9001fbf 	str	wzr, [x29, #28]			// [x29+28]=0x0

  400568:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  40056c:	911a6000 	add	x0, x0, #0x698
  400570:	97ffffb8 	bl	400450 <puts@plt>		// puts()
  400574:	b9401fa0 	ldr	w0, [x29, #28]		// w0=[x29+28]
  400578:	11000400 	add	w0, w0, #0x1		// w0=w0+0x1
  40057c:	b9001fa0 	str	w0, [x29, #28]		// [x29+28]=w0
  400580:	b9401fa0 	ldr	w0, [x29, #28]		// w0=[x29+28]
  400584:	7100281f 	cmp	w0, #0xa		// w0-0x
  400588:	5400004d 	b.le	400590 <main+0x34>	// 带符号 <=
  40058c:	14000005 	b	4005a0 <main+0x44>
  400590:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  400594:	911aa000 	add	x0, x0, #0x6a8
  400598:	97ffffae 	bl	400450 <puts@plt>	// puts()
  40059c:	17fffff3 	b	400568 <main+0xc>

  4005a0:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  4005a4:	911a6000 	add	x0, x0, #0x698
  4005a8:	97ffffaa 	bl	400450 <puts@plt>
  4005ac:	b9401fa0 	ldr	w0, [x29, #28]		// w0=[x29+28]
  4005b0:	51000400 	sub	w0, w0, #0x1		// w0=w0-0x1
  4005b4:	b9001fa0 	str	w0, [x29, #28]
  4005b8:	b9401fa0 	ldr	w0, [x29, #28]
  4005bc:	7100001f 	cmp	w0, #0x0
  4005c0:	540000ab 	b.lt	4005d4 <main+0x78>  // b.tstop
  4005c4:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  4005c8:	911aa000 	add	x0, x0, #0x6a8
  4005cc:	97ffffa1 	bl	400450 <puts@plt>
  4005d0:	17fffff4 	b	4005a0 <main+0x44>

  4005d4:	d503201f 	nop
  4005d8:	52800000 	mov	w0, #0x0                   	// #0
  4005dc:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4005e0:	d65f03c0 	ret
  4005e4:	00000000 	.inst	0x00000000 ; undefined

#endif
